package org.learn.spring5.service.impl;

import org.learn.spring5.dao.UserDao;
import org.learn.spring5.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements UserService {

    private static final Logger log= LoggerFactory.getLogger(UserServiceImpl.class);

    @Autowired
    private UserDao userDao;
    public void transferAccount() {
        log.info("执行了 transferAccount 方法");
        //小明转账100，减少100元
        userDao.reduceMoney();
        int i = 10/0;
        //小红账户增加100元
        userDao.addMoney();
    }
}
